﻿
@{
    ViewBag.Title = "调拨单详情";
    Layout = "~/Views/Shared/_LayoutPage.cshtml";
}
@model IOA.MES.DataAccess.VModel.VAllocateOrder

@section Contents{
    <style>
        .layui-form-label {
            width: auto !important;
        }
    </style>
}

<div id="page"></div>

<script type="text/template" id="tplPage">
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        @{ string WorkOrderNo = Model == null ? string.Empty : Model.WorkOrderNo.ToString();}
                        <label class="layui-form-label">{{lang.Field.WorkorderNo}}： @Html.Raw(WorkOrderNo)</label>
                    </div>
                    <div class="layui-inline">
                        @{ string AllocateNo = Model == null ? string.Empty : Model.AllocateNo;}
                        <label class="layui-form-label">{{lang.Field.AllocateOrderNo}}： @Html.Raw(AllocateNo)</label>
                    </div>
                    <div class="layui-inline">
                        @{ string AllocateTime = Model == null ? string.Empty : Model.AllocateTime.ToString();}
                        <label class="layui-form-label">{{lang.Field.AllocateTime}}： @Html.Raw(AllocateTime)</label>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        @{ string FromWarehouseCode = Model == null ? string.Empty : Model.FromWarehouseCode;}
                        <label class="layui-form-label">{{lang.Field.FromWarehouseCode}}： @Html.Raw(FromWarehouseCode)</label>
                    </div>
                    <div class="layui-inline">
                        @{ string FromWarehouse = Model == null ? string.Empty : Model.FromWarehouse;}
                        <label class="layui-form-label">{{lang.Field.FromWarehouse}}： @Html.Raw(FromWarehouse)</label>
                    </div>
                    <div class="layui-inline">
                        @{ string ToWarehouseCode = Model == null ? string.Empty : Model.ToWarehouseCode;}
                        <label class="layui-form-label">{{lang.Field.ToWarehouseCode}}： @Html.Raw(ToWarehouseCode)</label>
                    </div>
                    <div class="layui-inline">
                        @{ string ToWarehouse = Model == null ? string.Empty : Model.ToWarehouse;}
                        <label class="layui-form-label">{{lang.Field.ToWarehouse}}： @Html.Raw(ToWarehouse)</label>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        @{ string Remark = Model == null ? string.Empty : Model.Remark;}
                        <label class="layui-form-label">{{lang.Field.Remark}}： @Html.Raw(Remark)</label>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-card">
            <div class="layui-card-body">
                <table id="table" lay-filter="table"></table>
            </div>
        </div>
    </div>
</script>

@section Scripts{
    <script>
        var vm = new Vue({
            el: "#page",
            template: "#tplPage",
            data: {
                lang: JSON.parse(lang).package
            }
        });

        setTimeout(function () {
            initLayui();
        }, 50);
        function initLayui() {
            layui.use(['table', 'layer', 'form'], function () {
                var table = layui.table;
                var options = {
                    elem: '#table'
                    , url: '/AllocateOrder/QueryAllocateProducts'
                    , method: "post"
                    , where: { allcateOrderNo: "@Model.AllocateNo" }
                    , page: true
                    , limit: 15
                    , limits: [15, 20, 25, 30, 40, 50]
                    , response: {
                        statusName: 'ErrCode'
                        , statusCode: 200
                        , msgName: 'ErrCode'
                        , countName: 'TotalCount'
                        , dataName: 'Data'
                    }
                    , cols: [[
                        { type: 'numbers', title: '序号', width: 60 }
                        , { field: 'ProductCode', title: '物料编码', minWidth:200 }
                        , { field: 'ProductName', title: '物料名称', minWidth: 150 }
                        , { field: 'Specifications', title: '规格型号', minWidth: 150 }
                        , { field: 'BatchNo', title: '批次号', minWidth: 200 }
                        , { field: 'Quantity', title: '发货数量', minWidth: 100 }
                        , { field: 'ReceiveQuantity', title: '实收数量', minWidth: 100 }
                        , { field: 'ProductionCompany', title: '生产厂商', minWidth: 100 }
                        , { field: 'Unit', title: '单位', minWidth: 100 }
                        , { field: 'Effectiveness', title: '效率', minWidth: 100 }
                        , { field: 'Power', title: '功率', minWidth: 100 }
                        , { field: 'Thickness', title: '厚度', minWidth: 100 }
                        , { field: 'Color', title: '颜色', minWidth: 100 }
                        , { field: 'PO', title: 'PO', minWidth: 100 }
                        , { field: 'ProductionOriginCertification', title: '产地证', minWidth: 100 }
                    ]]
                };
                table.render(options);
            });
        }
    </script>
}
